﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace Infrastructure.Data
{
    public static class ObjectContextManager
    {
        private static IContextCreator _creator;

        public static void init(IContextCreator creator)
        {
            if (creator == null)
            {
                throw new Exception();
            }
            _creator = creator;
        }

        public static ObjectContext context
        {
            get
            {
                return _creator.CreateContext();
            }

        }
    }


}
